﻿Public Class CancelModifiche

    Public Class CancelModify
        Public intID As Integer
        Public strNomeCampo As String

        Public strValoreModifyto As String
        Public intIDModifyto As Integer

        Public Sub New(ByVal inId As Integer, ByVal inNameCampo As String, ByVal inValoreModifyto As String, ByVal inIDModifyto As Integer)
            intID = inId
            strNomeCampo = inNameCampo
            strValoreModifyto = inValoreModifyto
            intIDModifyto = inIDModifyto
        End Sub

    End Class

    Public Class ListCancel
        Inherits Stack(Of CancelModify)

        Public Property cmdRipristina As Button

        Public Sub New(ByRef inButton As Button)
            MyBase.New()
            cmdRipristina = inButton
        End Sub

        Public Overloads Sub Push(ByVal item As CancelModify)
            MyBase.Push(item)
            cmdRipristina.Enabled = True
        End Sub

        Public Overloads Function Pop() As CancelModify
            If Me.Count = 1 Then
                cmdRipristina.Enabled = False
            End If
            Return MyBase.Pop
        End Function

        Public Overloads Sub Clear()
            cmdRipristina.Enabled = False
            MyBase.Clear()
        End Sub

    End Class

End Class
